#ifndef TOKENIZER_H
#define TOKENIZER_H

#include <QMainWindow>
#include <string>
#include <iostream>
#include <QHash>
#include <QStringList>
#include <QString>

using namespace std;



namespace Ui {
    class Tokenizer;
}

class Tokenizer : public QMainWindow {
    Q_OBJECT
public:
    Tokenizer(QWidget *parent = 0);
    ~Tokenizer();


public slots:
    void Execution();
    void OpenFile();
    bool SaveFile();
    void SaveAs();
    void Tokenize();

protected:
    virtual void closeEvent(QCloseEvent *e);

private:
    Ui::Tokenizer *ui;
    

private:
    bool check_for_save();
    void splitting();
    void tokenization();
    void loadStopWord();
    void removeStopWords(QStringList &list, const QStringList &stopList);
    void loadVerbForms();
    void replaceVerbForms (QStringList &list, const QStringList &infin, const QStringList &pt, const QStringList &pp);
    void loadNouns();
    void replaceNounForms (QStringList &list, const QStringList &sing, const QStringList &pl);
    void countWords (QStringList &list);
    void WordCount ();
    void stemmer();

    QString MText;
    QStringList TSplitter;
	
    QStringList Token;
    QStringList StemmedToken;
    QStringList Key;
    QStringList Value;
	
    QStringList StopList;
    QStringList Infinitive,PastTense, PastPerf;
    QStringList nSingular, nPlural;
    QHash<QString, int> countWord;

};

#endif // TOKENIZER_H
